#ifndef GLOBPREF_H_
#define GLOBPREF_H_

#include "scHeader.h"
#include <QObject>
#include <QDateTime>

namespace sybilpm
{

/**
 * Global preferences, a singleton.
 */
class GlobPref : public QObject
{
	Q_OBJECT
//signals:

public:
	/**
	 * UTC based "far back" and "far future" timestamps.
	 */
	static const QDateTime timeMinQ;
	static const QDateTime timeMaxQ;
	/**
	 * singleton access
	 * @return pointer to the one and only instance
	 */
	static GlobPref * get();
	static const char * QtTimeSpec2Txt(Qt::TimeSpec ts);

	/**
	 * Convenience function for getting a poijnter to the main window, e.g. as
	 * parent if nothing else is at hand.
	 */
	WinMain * getMainWindow();
	/**
	 * Flag, if debug texts / data shall be shown on GUI.
	 */
	void setDebugData(bool isVisible) {debugData=isVisible;}
	bool getDebugData() const {return debugData;}

//public slots:

private:
	GlobPref();
	~GlobPref();
	static GlobPref * inst;
	WinMain * wm;
	bool debugData;
};

} // namespace sybilpm

#endif /* GLOBPREF_H_ */
